<?php
// +----------------------------------------------------------------------
// | MC PHP[基于ThinkPHP6.1开发]
// +----------------------------------------------------------------------
// | Copyright (c) 2020-2023 http://www.mingchangruanjian.com
// +----------------------------------------------------------------------
// | Author jokerfei [ jokerfei377@gmail.com ]
// +----------------------------------------------------------------------
// | 铭畅软件 技术部 出品
// +----------------------------------------------------------------------
namespace app\common\model;

use think\db\exception\DbException;
use think\facade\Db;

class Order extends BaseModel
{
    protected $name = 'order';

    public static $orderTypes = [
        1 => 'android会员充值',
        2 => 'iOS会员充值',
        3 => '商品购买'
    ];

    public const SELECT_LIST_STATUS = ['-2'=>'交易关闭','-1'=>'已取消','0'=>'待支付','1'=>'已支付,待发货','2'=>'待收货','3'=>'已完成，待评价','4'=>'已评价'];

    public const SELECT_LIST_PAY_TYPE = ['wxpay'=>'微信支付','minipay'=>'微信小程序支付','wxcode'=>'微信公众号支付','alipay'=>'支付宝支付','wallet'=>'钱包支付','score'=>'积分支付','zero'=>'零元付',];

    public const SELECT_LIST_PLATFORM = [
        'H5'=>'H5',
        'wxOfficialAccount'=>'微信公众号',
        'wxMiniProgram'=>'微信小程序',
        'App'=>'App',
    ];

    public function user()
    {
        return $this->belongsTo(\app\admin\model\user\User::class, 'user_id', 'id');
    }
}